﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using DataAccess.DataObject;
using DataAccess.BusinessObject;

namespace EnmineKaitlin
{
    public partial class survey : Common.PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSurvey_Click(object sender, EventArgs e)
        {
            try
            {                               
                _OSurvey.GuestName = txtName.Text;
                _OSurvey.Job = txtJob.Text;
                _OSurvey.Age = int.Parse(txtAge.Text);
                _OSurvey.Address = txtAddress.Text;
                _OSurvey.EstateType = rdlLoaiBDS.SelectedValue;
                _OSurvey.Area = txtDienTich.Text;
                _OSurvey.Price = rdlKhoangGia.SelectedValue;
                _OSurvey.Direction = rdlHuong.SelectedValue;
                _OSurvey.FutaLand = rdlEnmineKaitlin.SelectedValue;
                _OSurvey.Region = txtKhuVuc.Text;
                _OSurvey.Why = txtLyDo.Text;
                if (_BSurvey.Add(_OSurvey))
                {
                    lblNotice.Text = "Khảo sát thành công, xin chân thành cảm ơn !";
                }
            }
            catch (Exception ex)
            {
                lblNotice.Text = "Đã xảy ra lỗi vui lòng thử lại !";
            }
        }
    }
}
